<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class InitImageTag extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        // 通用分类表， 比如商品分类、文章分类 
        Schema::create('image_tags', function (Blueprint $table) {
            $table->comment = '角标表';
            
            $table->increments('id');
            $table->uuid('uuid')->index();

            $table->string('image', 255)->nullable()->comment('角标图片'); 
            $table->string('title', 30)->comment('角标名称');    
            $table->tinyInteger('location')->default(1)->comment('角标位置, 1为右上角，2为左上角');    

            $table->softDeletes();
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::disableForeignKeyConstraints(); 
        Schema::dropIfExists('image_tags');
    }
}
